package com.masterclient.app.modules.shop.adapter;

import android.graphics.Color;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.masterclient.app.R;
import com.masterclient.app.modules.shop.beans.StockChangeBean;

public class StockFilterPopAdapter extends BaseQuickAdapter<StockChangeBean.SearchSelectBean.specBean.defaultBean, BaseViewHolder> {

    private final String selectValue;

    public StockFilterPopAdapter(String selectValue) {
        super(R.layout.item_stock_filter_pop);
        this.selectValue = selectValue;
    }

    @Override
    protected void convert(BaseViewHolder helper, StockChangeBean.SearchSelectBean.specBean.defaultBean item) {
        TextView time = helper.getView(R.id.time);
        time.setText(item.title);
        if (selectValue.equals(item.value)) {
            time.setBackgroundResource(R.drawable.bg_stock_change_selected);
            time.setTextColor(Color.parseColor("#FF6809"));
        } else {
            time.setBackgroundResource(R.drawable.shape_radius14_f0f2f5);
            time.setTextColor(Color.parseColor("#141922"));
        }
    }
}
